<template>
    <div>
        <van-nav-bar title="订单结算页" left-arrow @click-left="onClickLeft" @click-right="onClickRight" />

        <DeliveryTabs @tab-change="handleTabChange" />

        <div v-if="currentTab === 'delivery'">
            <DeliverySection />
        </div>
        <div v-else>
            <PickupSection />
        </div>
    </div>
</template>

<script setup>
import { ref } from 'vue';
import DeliveryTabs from '@/views/DeliveryTabs.vue';
import DeliverySection from '@/views/delivery.vue';
import PickupSection from '@/views/PickupSection.vue';

const currentTab = ref('delivery');


const handleTabChange = (tab) => {
    currentTab.value = tab;
};


const onClickLeft = () => {
    history.back();
};

</script>